# Username="222407855022"
# password="123456"
#
#
# name=str(input("请输入用户名:"))
# pass_word=str(input("请输入密码:"))
#
# if (name==Username and pass_word==password):
#     print("登陆成功")
# else:
#     print("登录失败，用户名或密码错误")


# n=0
# while n<10:
#     print("dewdrf")
#     n+=1
#
# print("wedrfa\n"*10)

# num=0
# sum=0
# while num<10:
#     num+=1
#     sum+=num
#
# print(sum)

# num=0
# while num<10:
#     num+=1
#     print(f"num:{num}")
#     break;
# else:
#     print("整个循环，已经完成执行")

# notice="34 drf43f"
# for i in notice:
#     print(i)

# pets=['小花','3e3','dew','dw']
# for i in pets:
#     print(i)

# name="edrfcerc23e2"
# for i in name:
#     print(i)
#     break
# else:
#     print("234")

#反转字符串
# notice="abcdefg"
# str=""
# for c in notice:
#     #print(c)
#     str=c+str
# print(str)

# x=0
#
# for x in range(1,101):
#     if(x%2==0):
#         print(x)

# for i in range(1,11):
#     if i==6:
#         #break
#         continue
#     print(i)
#con=True
# while True:
#     a=int(input("请输入第一个数值："))
#     b=int(input("请输入第二个数值："))
#     if(a>100 or b>100):
#         print("输入数字有问题，请重新输入")
#         continue
#     result =a+b
#
#     print(f'结果为：{result}')
#     is_quit=input("是否退出（quit：退出，其他：不退出，继续）")
#     if(is_quit=="quit"):
#         break

# i=0
# for i in range(1,101):
#     if(i%3==0):
#         print(i)
#     i+=1

# for i in range(1,6):
#     for j in range(1,3):
#         print(j)

#for i in range(1,10):
#     for j in range(1,i+1):
#         print("%d*%d=%d"%(j,i,i*j),end="\t")
#     print(end="\n")

# age=10
#
# if age>15:
#     pass
# else:
#     pass

#1、准备一个三位数的数值
#num=int(input("请输入三维数值:"))
#print(num)

# if  not (100<=num<=999):
#     print("输入数据有误")
#     exit()
# else:
#
#     #2、判断是否是水仙花数
#     result=(((num%10)**3+(num//10%10)**3+(num//100)**3)==num)



    #3、打印结果
    # if result:
    #     print(f"{num}是水仙花数")
    # else:
    #     print(f"{num}不是水仙花数")


"""
猜数字
"""

#1.准备数据
num=500
count=0

while True:
    count+=1
    #2.数据处理
        #2.1 用户输入
    result=int(input("请输入一个数:"))

        #2.2 和给定的数据比较
            #相等给出提示，退出

    if (result==num):
        print(f"恭喜你猜对了，总共猜了{count}次,答案是：{result}")
        #exit()
        break

            #不相等给出提示，继续猜
                # 猜大了
    if result>num:
        print("猜大了")
                # 猜小了
    else:
        print("猜小了")

